const {ccclass, property, inspector} = cc._decorator;

@ccclass
@inspector("packages://autoproperty/inspector.js")
export default class win_package extends cc.Component{
	view:fgui.Window;
	win_param:any;

	onLoad(){
		console.log('package onload');
		this.view = new fgui.Window();
		
		this.view.contentPane = fgui.UIPackage.createObject("window","win_package").asCom;//包名,组件名
        //fgui.UIConfig.modalLayerColor = new cc.Color(0,0,0,178);
        
		this.view.modal = true;		
		this.view.center();
		this.view.setPivot(0.5, 0.5);
		this.view.setScale(0.1, 0.1);  
		
		

		this.view.contentPane.getChild('frame').asCom.getChild('closeButton').onClick(this.close,this)
		//this.view.contentPane.getChild('frame').asCom.getChild('n13').node.active = false;
		   
	}

	onEnable(){
		console.log('package onenable',this.win_param);
		fgui.GTween.to2(0.1, 0.1, 1, 1, 0.3)
        	.setTarget(this.view, this.view.setScale)
			.setEase(fgui.EaseType.QuadOut);
		this.view.show();   
	}

	close(){
		this.node.active = false;
	}

	public again(){
		fgui.GTween.to2(0.1, 0.1, 1, 1, 0.3)
		.setTarget(this.view, this.view.setScale)
		.setEase(fgui.EaseType.QuadOut);
		orc.orc_data.memory_data.user_info['money'] = 10;
		
		this.view.show();
		
	}

}
